package com.geostar.constructionland.analyse.service.analyse.impl;

import com.geostar.constructionland.analyse.entity.HttpResult;
import com.geostar.constructionland.analyse.entity.model.AnalyseModel;
import com.geostar.constructionland.analyse.entity.resulthandler.HandlerResult;
import com.geostar.constructionland.analyse.service.analyse.IAnalyse;
import com.geostar.constructionland.analyse.service.handler.IResultHandler;
import com.geostar.constructionland.analyse.service.spatiaanalyst.ISpatialAnalyst;
import lombok.Data;

/**
 * @author yelll
 * @since 2020-5-27 10:51
 **/
@Data
public class Analyse implements IAnalyse {
    private ISpatialAnalyst spatialAnalyst;
    private IResultHandler resultHandler;
    private AnalyseModel analyseModel;
    public Analyse(ISpatialAnalyst spatialAnalyst, IResultHandler resultHandler,AnalyseModel analyseModel){
        this.spatialAnalyst = spatialAnalyst;
        this.resultHandler = resultHandler;
        this.analyseModel = analyseModel;
    }

    @Override
    public HttpResult sptAnalyse() throws Exception{
        return spatialAnalyst.sptAnalyse(analyseModel);
    }

    @Override
    public HandlerResult handler(HttpResult httpResult) throws Exception {
        return resultHandler.handler(analyseModel,httpResult);
    }


}
